package net.oschina.app.fragment.tweetsfragments;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

import com.jcodecraeer.xrecyclerview.XRecyclerView;

import net.oschina.app.R;
import net.oschina.app.adapter.tweetsadapter.TweetsListAdapter;
import net.oschina.app.bean.Tweet;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ldl on 2017/4/5.
 */

public class XiangqingActivity extends Activity {

    private XRecyclerView mXRecyclerView;
    private Toolbar mToolbar;
    private List<Tweet> mTweetslist = new ArrayList();
    private TweetsListAdapter mTweetsListAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tweets_detail);
        // 设置详情页面ToolBar
        mToolbar = (Toolbar) findViewById(R.id.toolBar);
        mToolbar.setNavigationIcon(R.drawable.actionbar_back_icon_normal);
        mToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                // ！！设置箭头点击事件！！finish();可不可以？？
                finish();
                return false;
            }
        });
        // 评论区列表
        mXRecyclerView = (XRecyclerView) findViewById(R.id.xrv_detail);
        mTweetsListAdapter = new TweetsListAdapter(mTweetslist);
        mXRecyclerView.setAdapter(mTweetsListAdapter);
    }
}
